# @Time    :2025/8/11 下午2:55
# @Author  :XiaoJiang
# @File    :一对多.py
# @Software: PyCharm
import os



if __name__ == '__main__':
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Django_tushuguanli_demo.settings')
    import django
    django.setup()

    from app.models import Book


    # 从多方查找一方
    # book = Book.objects.get(id=1)
    # print(book)
    # print(book.press.pressname)

    # 从一方查找多方
    # booklist = Book.objects.filter(press_id=1)
    # print(booklist)
